<template lang="pug">
.app-container(@click="setName") 首页内容1{{ count }}{{ listData.limit }}{{name}}
</template>

<script setup>
import { ref, reactive, toRefs, getCurrentInstance } from 'vue'
// import { useStore } from 'vuex'
// const store = useStore()

const { proxy } = getCurrentInstance()

const { name } = toRefs(reactive(proxy.$store.getters))
const count = ref(0)
const listData = reactive({
  limit: 12
})

// 改变 name
function setName () {
  proxy.$store.dispatch('setName')
}
</script>

<style lang="scss">
</style>
